﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nauka.database
{
    public class DBSettings
    {
        public string serverName { get; set; }
        public string dbName { get; set; }
        public string userName { get; set; }
        public string password { get; set; }
        private string connectionString;

        public string connection_string
        {
            get
            {
                return connectionString;
            }
        }

        public DBSettings(string sn, string dbn, string un, string pass)
        {
            this.serverName = sn;
            this.dbName = dbn;
            this.userName = un;
            this.password = pass;
            buildConnectionString();
        }

        public string buildConnectionString(){
            connectionString = String.Format(@"Server={0};Database={1};User ID={2};Pwd={3};Connect Timeout=15",
            serverName, dbName, userName, password);

            return connectionString;
        }
    }
}
